package classes.Commands
{
	import components.editor.c_baseElement;
	
	import flash.geom.ColorTransform;
	
	public class c_applyColorTransform extends c_baseCommand {
		private var _safeMatrix: ColorTransform;
		private var _applyMatrix: ColorTransform;
		public function c_applyColorTransform(a_element:c_baseElement, a_matrix: ColorTransform) {
			super(a_element);
			_applyMatrix = a_matrix;
			
			_safeMatrix = new ColorTransform();
			_safeMatrix.concat(element.transform.colorTransform);
		}
		
		override public function Execute():void {
			var ct: ColorTransform = element.transform.colorTransform;
			ct.concat(_applyMatrix);
			element.transform.colorTransform = ct;
		}
		
		override public function unExecute():void {
			element.transform.colorTransform = _safeMatrix;
		}
	}
}